package com.xiang.reflection;

import sun.management.resources.agent;
import sun.tools.jar.resources.jar;

public class test06 {
    public static void main(String[] args) throws ClassNotFoundException {

        //获取系统类加载器
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        System.out.println(systemClassLoader);

        //获取系统类加载器的父类加载器--》扩展类加载器
        ClassLoader parent = systemClassLoader.getParent();
        System.out.println(parent);

        //获取扩展类加载器的父类加载器--》根加载器(c/c++)
        ClassLoader parent1 = parent.getParent();
        System.out.println(parent1);

        //测试当前类是哪个加载器加载的
        ClassLoader classLoader = Class.forName("com.xiang.reflection.test06").getClassLoader();
        System.out.println(classLoader);

        //测试jdk内置的类是谁加载的
        ClassLoader classLoader1 = Class.forName("java.lang.Object").getClassLoader();
        System.out.println(classLoader1);

        //如何获得系统类加载器可以加载的路径
        System.out.println(System.getProperty("java.class.path"));

        //双亲委派机制，创建对象后先向上找包，找不到了再用自己的。
        //java.lang.string.

        /*E:\jdk1.8\jre\lib\charsets.jar;
        E:\jdk1.8\jre\lib\deploy.jar;
        E:\jdk1.8\jre\lib\ext\access-bridge-64. jar;
        E:\jdk1.8\jre\lib\ext\cldrdata.jar;
        E:\jdk1.8\jre\lib\ext\dnsns.jar;
        E:\jdk1.8\jre\lib\ext\jaccess.jar;
        E:\jdk1.8\jre\lib\ext\jfxrt.jar;
        E:\jdk1.8\jre\lib\ext\localedata.jar;
        E:\jdk1.8\jre\lib\ext\nashorn.jar;
        :\jdk1.8\jre\lib\ext\sunec.jar;
        E:\jdk1.8\jre\lib\ext\sunjce_provider.jar;
        E:\jdk1.8\jre\lib\ext\sunmscapi.jar;
        E:\jdk1.8\jre\lib\ext\sunpkcs11.jar;
        E:\jdk1.8\jre\lib\ext\zipfs.jar;
        E:\jdk1.8\jre\lib\javaws.jar;
        E:\jdk1.8\jre\lib\jce.jar;
        E:\jdk1.8\jre\lib\jfr.jar;
        E:\jdk1.8\jre\lib\jfxswt.jar;
        E:\jdk1.8\jre\lib\jsse.jar;
        E:\jdk1.8\jre\lib\management- agent.jar;
        E:\jdk1.8\jre\lib\plugin.jar;
        E:\jdk1.8\jre\lib\resources.jar;
        E:\jdk1.8\jre\lib\rt.jar;
        E:\project_list\java_base(20210601)\out\production\java_base(20210601);
        E:\app\IntelliJ IDEA 2020.3\lib\idea_rt.jar*/

    }
}
